package com.tedu.services;

import com.alibaba.druid.util.StringUtils;
import com.tedu.mapper.SmbmsProviderMapper;
import com.tedu.mapper.SmbmsUserMapper;
import com.tedu.pojo.SmbmsProvider;
import com.tedu.pojo.SmbmsProviderExample;
import com.tedu.pojo.SmbmsUser;
import com.tedu.pojo.SmbmsUserExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户服务层接口实现类  交给spring管理
 */

@Service  //该组件是服务层的实现类并且交给了spring管理
public class ProviderServicesImpl implements ProviderServices {
    //完成了spring整合mybatis
    //spring容器中已经有mapper实现类对象
    //从spring容器中取出mapper对象

    @Autowired
    SmbmsProviderMapper providerMapper;


    @Override
    public List<SmbmsProvider> getAllProvider() {
        return providerMapper.selectByExample(new SmbmsProviderExample());
    }

    @Override
    public SmbmsProvider getProviderById(int pid) {
        return providerMapper.selectByPrimaryKey(new Long(pid));
    }


}